package com.zrrd.learn.chapter08面向对象.objectoriented01;

/**
 * 小汽车类
 *
 * @author wrn
 * @version 1.0
 * @date 2023/7/24 21:24
 */

public class Car extends Auto{

    private String kt;
    private String cd;

    public Car(){

    }
    public Car(int num,String color,int weight,int speed,String kt,String cd){

        this.kt=kt;
        this.cd=cd;
        System.out.println("小汽车有"+num+"个轮子，汽车颜色"+color+"，汽车车重"
                +weight+"吨，行驶速度为"+speed+"车内有"+
                kt+"还有"+cd);
    }

    @Override
    public void jiasu(){
        System.out.println("汽车加速了");
    }

    @Override
    public void jiansu(){
        System.out.println("汽车减速了");
    }

    @Override
    public void stop(){
        System.out.println("汽车停车了");
    }
    public void rewrite(int num, String color, int weight, int speed) {
        System.out.println("小汽车有"+num+"个轮子，汽车颜色"+color+"，汽车车重"
                +weight+"吨，行驶速度为"+speed+"车内有"+
                kt+"还有"+cd);
    }

}
